ci(pr-flow): add PR base guard — block stacked PRs - #227
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 46 minutes and 14 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a new GitHub Actions workflow that enforces pull requests to target the repository's default branch. The workflow validates on pull request open, reopen, edit, and synchronization events, failing with an error message and guidance about stacked PRs if the base branch differs from the default. ChangesPR Base Branch Guard
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@copilot please address the blocking signals on this PR and push a fix commit. Trigger: ci-failure Follow the PR's |
There was a problem hiding this comment.
Pull request overview
Adds a lightweight GitHub Actions guardrail to prevent stacked PRs (PRs targeting another PR branch), avoiding desync scenarios under squash merges + auto-merge.
Changes:
- Introduces a new workflow that fails any
pull_requestwhose base branch is not the repository default branch. - Emits a clear failure annotation instructing contributors to branch from the default branch and merge serially.
4fe427a to
a0809bb
Compare
a0809bb to
f58a6c0
Compare
Why
Sister project lazie had stacked PRs (#108/#109/#110) desync under squash + auto-merge today. Adding the same guard repo-wide.
Topology-aware auto-merge wouldn't fix it: squash merge produces new SHAs that downstream PR base refs don't reflect, so the chain breaks even with correct ordering.
What
.github/workflows/assert-base-is-default-branch.yml— any PR whosebase.ref != repository.default_branchfails. Branch from main, merge serially.Test plan
main→ check passes🤖 Generated with Claude Code
Summary by CodeRabbit